package com.hfut.eeg.dto;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.ArrayList;
import java.util.Objects;

/**
 * @author 梁琦
 * @program: eeg
 * @Package com.hfut.eeg.dto
 * @Description: TODO
 * @date 2019-12-15 16:52
 */
public class AIJsonPrase {
    @JSONField(name = "code")
    private Integer code;

    @JSONField(name = "message")
    private String message;

    @JSONField(name = "timeStamp")
    private String timeStamp;

    @JSONField(name = "content")
    private Content content;

    class Content{
        @JSONField(name = "fft")
        private ArrayList<ArrayList> fft;

        @JSONField(name = "errWaves")
        private EerWaves errWaves;

        @JSONField(name = "energy")
        private ArrayList energy;


        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            Content content = (Content) o;
            return Objects.equals(fft, content.fft) &&
                    Objects.equals(errWaves, content.errWaves) &&
                    Objects.equals(energy, content.energy);
        }

        @Override
        public int hashCode() {
            return Objects.hash(fft, errWaves, energy);
        }
    }

//    @Override
//    protected Object clone() throws CloneNotSupportedException {
//        AIJsonPrase aiJsonPrase = null;
//        try{
//            aiJsonPrase = (AIJsonPrase) super.clone();
//            if(content != null){
//                aiJsonPrase.setContent(content.);
//            }
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return super.clone();
//    }

    public AIJsonPrase() {
    }

    public AIJsonPrase(Integer code, String message, String timeStamp, Content content) {
        this.code = code;
        this.message = message;
        this.timeStamp = timeStamp;
        this.content = content;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(String timeStamp) {
        this.timeStamp = timeStamp;
    }

    public Object getContent() {
        return content;
    }

    public void setContent(Content content) {
        this.content = content;
    }
}
